package com.hirsi.module.menu.vo.result;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hirsi.core.expand.TreeNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@ApiModel("菜单树形列表")
@Data
public class MenuTreeResult implements TreeNode<MenuTreeResult, Integer> {

    @ApiModelProperty("id")
    private Integer id;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    private Integer pid;

    @ApiModelProperty(value = "名称", position = 1)
    private String name;

    @ApiModelProperty(value = "图标", position = 2)
    private String icon;

    @ApiModelProperty(value = "类型：0-菜单，1-操作", position = 3)
    private Integer type;

    @ApiModelProperty(value = "菜单地址/操作事件", position = 3)
    private String click;

    @ApiModelProperty(value = "按钮显示位置：0-工具栏，1-行按钮", position = 4)
    private Integer showPosition;

    @ApiModelProperty(value = "状态：0-正常，1-禁用", position = 5)
    private Integer status;

    @ApiModelProperty(value = "子级", position = 6)
    private List<MenuTreeResult> children;

    @Override
    public Integer getNodeId() {
        return id;
    }

    @Override
    public Integer getParentNodeId() {
        return pid;
    }
}
